<?php
/* ----------------------------------------------------------
--               JacoCMS by Jaco Ruit                      --
-------------------------------------------------------------
--     JacoCMS is Open Source and is lincenced under       --
--             GNU General Public Licence v3               --
--          http://www.gnu.org/copyleft/gpl.html           --
-------------------------------------------------------------
--       Please don't remove any text from the footers.    --
-------------------------------------------------------------
-- Credits:   * Jaco Ruit          ~     Scripts,MySQL     --     
-----------------------------------------------------------*/

#Installation Script JacoCMS
include 'config.php';
$conn = mysql_connect($databasehost, $databaseuser, $databasepassword) or die(mysql_error());
mysql_select_db($databasename) or die(mysql_error());
include '../includes/user.class.php';
$user = new User();


if((!isset($_POST['adminname'])) && (!isset($_POST['adminpw'])) && (!isset($_POST['adminemail'])) )
{
	echo "<p>Error, no variables found.</p>";
}
else
{
$name = mysql_real_escape_string($_POST['adminname']);
$pw = mysql_real_escape_string($_POST['adminpw']);
$email = mysql_real_escape_string($_POST['adminemail']);
$user->register($name, $pw, $email, '2');
?>
<html>
	<head>
		<title>JacoCMS - New Admin Account</title>
		<link href="style.css" rel="stylesheet" type="text/css" /> 
	</head>
	<body>
	<div id="panel">
		<center><img src="../style/default/logo.png" /></center>
		<h3>JacoCMS Installer ~ New Admin Account</h3><br />
		<p>Created new admin account</p><br />
		<p>Name: <?php echo $name ?></p>
		<p>Password: <?php echo $pw ?></p>
		<p>Email: <?php echo $email ?></p><br />
		<p><a href="finish.php">Finish</a> installer</p>
	</div>
	</body>
</html>

<?php
}

?>
